<template>
  <div>
    <MyHeader color="pink" bgc="skyblue"></MyHeader>
    <MyGoods v-for="(item, index) in list" :key="index" :item="item"></MyGoods>
    <MyFooter :list="list"></MyFooter>
  </div>
</template>

<script>
import MyCount from "@/components/MyCount.vue";
import MyFooter from "@/components/MyFooter.vue";
import MyGoods from "@/components/MyGoods.vue";
import MyHeader from "@/components/MyHeader.vue";
export default {
  data() {
    return {
      list: [],
    };
  },
  components: {
    MyCount,
    MyFooter,
    MyGoods,
    MyHeader,
  },
  created() {
    this.$axios({
      url: "/api/cart",
    }).then((res) => (this.list = res.data.list));
  },
};
</script>

<style></style>
